From ec7b9a1b9b2a935fa322eca98d95741ff6d162bb Mon Sep 17 00:00:00 2001 From: Gianni Tedesco Date: Tue, 7 Sep 2010 19:05:17 +0100 Subject: [PATCH] libxl: Fix NULL deref in libxl_ctx_free() xc_interface_close() will de-reference a NULL handle, check for this condition in libxl_ctx_free() before calling. Signed-off-by: Gianni Tedesco Acked-by: Ian Jackson Signed-off-by: Ian Jackson --- tools/libxl/libxl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 03d9a9380c..bd82653c7f 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -67,7 +67,7 @@ int libxl_ctx_init(libxl_ctx *ctx, int version, xentoollog_logger *lg) int libxl_ctx_free(libxl_ctx *ctx) { - xc_interface_close(ctx->xch); + if (ctx->xch) xc_interface_close(ctx->xch); libxl_version_info_destroy(&ctx->version_info); if (ctx->xsh) xs_daemon_close(ctx->xsh); return 0; -- 2.30.2